package com.example.dao;

import com.example.domain.LoginLog;
import com.example.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface UserDao extends JpaRepository<LoginLog, Integer> {
    @Query("SELECT count(u) FROM User u WHERE u.userName = ?1 and u.password = ?2")
    Long getMatchCount(String userName, String password);

    @Query("SELECT u FROM User u WHERE u.userName =?1")
    User findUserByUserName(final String userName);


}